package com.example.demo.excelprint;

public class PrintTest {
    public static void main(String[] args) {
        test2();
//        test1();
    }
    public static void test1(){
        String path="/print/2.xlsx";
        int copies=1;
        WPSPrintUtil.printExcel(path,copies);
    }
    public static void test2(){
        String srcFile=System.getProperty("user.dir")+"/print/1.xlsx";
        String destFile=System.getProperty("user.dir")+"/print/1-1204.pdf";
        PrintConfig printConfig=new PrintConfig();
//        printConfig.setPrintArea("false");
        printConfig.setPrintArea("$A$1:$BS$131");
        printConfig.setOrientation(1);
        printConfig.setZoom(100);
        printConfig.setPrintTitleColumns("A:B");
        printConfig.setOrder("1");
        ExcelToPDFUtil.jacobExcelToPDF(srcFile,destFile,printConfig);
    }
}

